"use strict";
var uid = require('uid');

class SocketHelper {
    constructor() {
        this._socketList = [];
    }
    addSocket(socket) {
        socket.uid = uid(10);
        this._socketList.push(socket);
    }
    removeSocket(socket) {
        var index = this._socketList.findIndex(function (item) {
            return item.uid === socket.uid;
        });
        if (index > -1) {
            this._socketList.splice(index, 1);
        }
    }
}

module.exports = SocketHelper;

